package com.study.springBoot.service;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.data.jpa.repository.JpaRepository;

import com.study.springBoot.domain.User;

import javax.persistence.Table;

@Repository
@Table(name = "user")
@Qualifier("userRepository")
public interface UserRepository extends JpaRepository<User, Long> {
    public User findOne(Long id);

    public User save(User u);

    @Query("select u from User u where u.name=:name")
    public User findUserByName(@Param("name") String name);
}
